{extend name="v1/layout/base"}
{block name="content"}
<div class="layui-row layui-col-space15">
  <div class="layui-col-md12">
      <form class="layui-card-body layui-form layui-form-pane">
        <div class="layui-row layui-col-space10 layui-form-item">
          <div class="layui-col-lg8">
            <label class="layui-form-label">会员等级名称：</label>
            <div class="layui-input-block">
              <input type="text" name="level_name" value="{$info.level_name}" lay-verify="required" lay-reqtext="请输入会员等级名称" placeholder="请输入会员等级名称" autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <div class="layui-row layui-col-space10 layui-form-item fileurlupload">
          <div class="layui-col-lg8">
            <label class="layui-form-label">等级图片：</label>
            <div class="layui-input-block">
              <div class="layui-upload">
                <div class="xk-big-show" datasrc="{$info['show_picurl']?$info['show_picurl']:'__COMMON__images/no_pic.png'}">
                  <input type="hidden" class="xk-picurl" name="picurl" value="{$info.picurl}">
                  <img class="layui-upload-img  xk-img upload-pic" id="img-show-1" src="{$info['show_picurl']?$info['show_picurl']:'__COMMON__images/no_pic.png'}" width="100px" height="100px">
                </div>
                {if condition="$info['picurl']"}
                <button class="layui-btn layui-btn-danger layui-btn-sm xk-del-pic" type="button" name="button"><i class="layui-icon">&#xe640;</i></button>
                {/if}
              </div>
            </div>
          </div>
        </div>
        <div class="layui-row layui-col-space10 layui-form-item">
          <div class="layui-col-lg8">
            <label class="layui-form-label">升级购买单数：</label>
            <div class="layui-input-block">
              <input type="text" name="buy_num" value="{$info.buy_num}" lay-verify="required" lay-reqtext="请输入升级购买单数" placeholder="请输入升级购买单数" autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <div class="layui-row layui-col-space10 layui-form-item">
          <div class="layui-col-lg8">
            <label class="layui-form-label">升级-团队累计：</label>
            <div class="layui-input-block">
              <input type="text" name="team_achievement_price" value="{$info.team_achievement_price}" lay-verify="required" lay-reqtext="请输入升级-团队累计" placeholder="请输入升级-团队累计" autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <div class="layui-row layui-col-space10 layui-form-item">
          <div class="layui-col-lg8">
            <label class="layui-form-label">升级-下等级数量：</label>
            <div class="layui-input-block">
              <input type="text" name="child_num" value="{$info.child_num}" lay-verify="required" lay-reqtext="请输入升级-下等级数量" placeholder="请输入升级-下等级数量" autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <div class="layui-row layui-col-space10 layui-form-item">
          <div class="layui-col-lg8">
            <label class="layui-form-label">代理佣金比例：</label>
            <div class="layui-input-block">
              <input type="text" name="agent_bili" value="{$info.agent_bili}" lay-verify="required" lay-reqtext="请输入升级-下等级数量" placeholder="请输入升级-下等级数量" autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <div class="layui-row layui-col-space10 layui-form-item">
          <div class="layui-col-lg8">
            <label class="layui-form-label">平级奖比例：</label>
            <div class="layui-input-block">
              <input type="text" name="avg_bili" value="{$info.avg_bili}" lay-verify="required" lay-reqtext="平级奖比例" placeholder="平级奖比例" autocomplete="off" class="layui-input">
            </div>
          </div>
        </div>
        <!-- 底部操作按钮 -->
        <div class="layui-row">
          <div class="layui-col-xs3">&nbsp;</div>
          <div class="layui-col-xs4">
            <input type="hidden" name="act" value="edit" />
            <input type="hidden" name="user_level_id" value="{$info.user_level_id}" />
            <button type="button" class="layui-btn layui-btn-primary layui-btn-radius" id="infoBackList"><i class="layui-icon">&#xe65c;</i>返回列表</button>
            <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit lay-filter="saveBtn"><i class="layui-icon">&#xe609;</i>立即更新</button>
          </div>
          <div class="layui-col-xs5">&nbsp;</div>
        </div>
        <!-- 底部操作按钮结束 -->
      </form>
  </div>
</div>
{/block}
{block name="myScript"}
<script>
  layui.use(['form'], function() {
    var form = layui.form,
      layer = layui.layer,
      $ = layui.$;
    //监听提交
    form.on('submit(saveBtn)', function(data) {
      var data = data.field,
          url = "{:url('/'.config('manage.manage_name').'/'.config('manage.version').'/User/userLevelSave')}";
      https(url, data, 'post', 1, '正在保存信息').then(res => {
        xkMsg(res.result_msg);
      }, fail => {})
      return false;
    });
  });
</script>
{/block}
